package cn.hiapi.user.query;

import cn.hiapi.basic.jpa.pageable.QueryWrapper;
import cn.hiapi.basic.jpa.query.BasicQuery;
import cn.hiapi.shopkeeper.enums.ActivityType;
import cn.hiapi.shopkeeper.enums.OrderStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @author AdinZ
 * @date 2023/1/1 10:26
 */
@Setter
@Getter
public class ActivityOrderQuery extends BasicQuery {

    @ApiModelProperty("订单状态")
    private OrderStatus status;

    @ApiModelProperty("活动类型")
    private ActivityType activityType;

    private long buyerId;


    @Override
    public QueryWrapper getQueryWrapper() {
        QueryWrapper wrapper = super.getBasicQueryWrapper();
        wrapper.eq("status", this.status)
                .eq("delStatus", 0)
                .eq("buyerId", buyerId)
                .eq("activityType", this.activityType);
        return wrapper;
    }
}
